﻿var FgcElement = FgcElement || {};

FgcElement.TableColumnSlots = FgcElement.TableColumnSlots || {};

FgcElement.TableColumnSlots.Content = FgcElement.TableColumnSlots.Content || {};

FgcElement.TableColumnSlots.Content["column-custom-render"] = function (scope) {
    //return `<div style="color: red;">{{ scope.row[scope.column.property] }}<div>`
}

//自动填写出库数量函数
//biao:表名，ppid：领料单物料id，nub：领料数量
function fuzhi2(nmb, ppid, biao) {
	var page = Forguncy.Page;
	var listview = page.getListView(biao);
	var count = listview.getRowCount();
	var biaonumber = 0;

	var bpid = 0;
	var heji = nmb;
	for (var i = 0; i < count; i++) {
		biaonumber = listview.getValue(i, "keyong_qty");
		bpid = listview.getValue(i, "product_id1");
		if (bpid == ppid) {
			if (parseInt(heji) > 0) {
				if (parseInt(biaonumber) < parseInt(heji)) {
					listview.setValue(i, "qty_null", parseInt(biaonumber));
					heji = parseInt(heji) - parseInt(biaonumber);

				} else {
					listview.setValue(i, "qty_null", parseInt(heji));
					return;
				}
			}
		}


	}
}
